package net.sudot.chess.business.service;

import net.sudot.chess.business.dao.GameRankLimitDao;
import net.sudot.chess.business.model.GameRankLimit;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 游戏等级限制(即:某个游戏可以参加的用户等级)
 *
 * @author tangjialin on 2018-02-27.
 */
@Service
public class GameRankLimitService extends BaseService<GameRankLimit> {

    @Resource
    private GameRankLimitDao gameRankLimitDao;

    /**
     * 检测某一个等级的客户是否能参与该游戏
     *
     * @param gameId         游戏主键
     * @param customerRankId 客户等级主键
     * @return 返回true:可以参与,false:不能参与
     */
    public boolean exist(Long gameId, Long customerRankId) {
        return gameRankLimitDao.exist(gameId, customerRankId);
    }
}
